Socket
Socket
Sign inDemoInstall

@cubejs-client/core

Package Overview
Dependencies
15
Maintainers
3
Versions
223
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @cubejs-client/core

cube.js client


Version published
Maintainers
3
Created

Package description

What is @cubejs-client/core?

@cubejs-client/core is a JavaScript client for Cube.js, an open-source analytical API platform. It allows developers to query and interact with Cube.js to build analytical applications. The package provides functionalities for querying data, managing sessions, and handling real-time updates.

What are @cubejs-client/core's main functionalities?

Querying Data

This feature allows you to query data from Cube.js. The code sample demonstrates how to load data with specific measures, time dimensions, and other dimensions.

const cubejs = require('@cubejs-client/core');
const cubejsApi = cubejs('YOUR-CUBEJS-API-TOKEN');

cubejsApi.load({
  measures: ['Orders.count'],
  timeDimensions: [{
    dimension: 'Orders.createdAt',
    dateRange: ['2020-01-01', '2020-12-31']
  }],
  dimensions: ['Orders.status']
}).then(resultSet => {
  console.log(resultSet.tablePivot());
});

Managing Sessions

This feature allows you to manage sessions with Cube.js. The code sample shows how to request a session and log the session ID.

const cubejs = require('@cubejs-client/core');
const cubejsApi = cubejs('YOUR-CUBEJS-API-TOKEN');

cubejsApi.requestSession().then(session => {
  console.log('Session ID:', session.id);
});

Handling Real-Time Updates

This feature allows you to handle real-time updates from Cube.js. The code sample demonstrates how to subscribe to data changes and handle updates using a callback function.

const cubejs = require('@cubejs-client/core');
const cubejsApi = cubejs('YOUR-CUBEJS-API-TOKEN');

cubejsApi.subscribe({
  measures: ['Orders.count'],
  timeDimensions: [{
    dimension: 'Orders.createdAt',
    dateRange: ['2020-01-01', '2020-12-31']
  }],
  dimensions: ['Orders.status']
}, {
  onNext: (resultSet) => {
    console.log(resultSet.tablePivot());
  }
});

Other packages similar to @cubejs-client/core

Changelog

Source

0.33.59 (2023-09-20)

Features

  • cubesql: EXTRACT SQL push down (#7151) (e30c4da)
  • cubesql: Add ability to filter dates inclusive of date being passed in when using <= or >= (#7041) Thanks @darapuk ! (6b9ae70)
  • native: Cube.py - support all options (#7145) (5e5fb18)

Readme

Source

Cube.js

WebsiteDocsBlogSlackTwitter

npm version GitHub Actions

Cube.js Client Core

Cube.js Client core set of methods to access Cube.js API Gateway.

Learn more

License

Cube.js Client Core is MIT licensed.

FAQs

Last updated on 20 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc